package com.nbufe.command.demo2;

/**
 * @Author Zan
 * @Create 2024/6/12 14:05
 * @ClassName: CalculatorForm
 * @Description : TODO 请用一句话描述该类的功能
 */
public class CalculatorForm {

    private AbstractCommand command;

    public void setCommand(AbstractCommand command) {
        this.command = command;
    }


    public void execute(int value) {
        int i = command.execute(value);
        System.out.println("执行运算，结果：" + i);
    }

    public void undo() {
        int i = command.undo();
        System.out.println("执行撤销，结果：" + i);
    }

    public void redo() {
        int i = command.redo();
        System.out.println("执行恢复，结果：" + i);
    }
}
